home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 4_7.lha / 4_7 / 4_7.c next >
Text File  |  1993-08-08  |  846b  |  38 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. ifdef TESTA
  6.  include "4_7A.h"            /* class tnode */
  7.  include "4_7b.c"            /* void addnode(tree, char*) */
  8. endif
  9.  
  10. ifdef TESTB
  11.  include "4_7B.h"            /* class tnode */
  12.  include "4_7e.c"            /* void addnode(tree, char*) */
  13. endif
  14.  
  15. include "4_7a.c"            /* tree newtree() */
  16. include "4_7c.c"            /* void printtree(tree) */
  17. include "4_7d.c"            /* void aprinttree(tree) */
  18.  
  19. har *x[] =
  20.  
  21.    "hello", "there", "this", "is", "a", "test", "of", "lists",
  22.    "the", "quick", "brown", "fox", "jumped", "over", "the", "lazy", "black", "dog", 0
  23. ;
  24.  
  25. ain()
  26.  
  27.    tree t = newtree();
  28.  
  29.    for (char **xp = x; *xp; xp++)
  30. addnode(t, *xp);
  31.  
  32.    cout << "tree:\n";
  33.    printtree(t);
  34.    cout << "alphabetic tree:\n";
  35.    aprinttree(t);
  36.    return 0;
  37.  
  38.